package offer;

/**
 * 描述:
 *
 * @author Madison You
 * @created 23:20
 */
public class ListNode {

    int val;
    ListNode next;
    ListNode() {}
    ListNode(int val) { this.val = val; }
    ListNode(int val, ListNode next) { this.val = val; this.next = next; }

    public static ListNode createNode(int[] arr) {
        ListNode head = new ListNode(arr[0]);
        ListNode other = head;
        for (int i = 1; i < arr.length; i++) {
            ListNode temp = new ListNode(arr[i]);
            other.next = temp;
            other = other.next;
        }
        return head;
    }
}

